package Thread;

/**
 * @author liyang
 * @version 1.0
 * @package Thread
 * @file ThreadDemo.java
 * @description
 * @time 2024-04-05 12:17
 */
public class ThreadDemo {
    public static void main(String[] args) {
        Thread t1 = new MyThread1();
        Thread t2 = new MyThread2();

        //start会自己去调用run方法
        t1.start();
        t2.start();
    }
}

class MyThread1 extends Thread{
    @Override
    public void run() {
        for (int i=0;i<1000;i++){
            System.out.println("你寄博谁？");
        }
    }
}

class MyThread2 extends Thread{
    @Override
    public void run() {
        for (int i=0;i<1000;i++){
            System.out.println("What can i say?");
        }
    }
}